
<!DOCTYPE html>
<html>
	<head>
		<title>新疆汽配网后台 - 登录</title>
		<link rel="stylesheet" type="text/css" href="/Public/layui/css/layui.css">
		<style type="text/css">
			.login{
				width:400px; margin:150px auto;
				background:#fff; padding:40px; border:1px solid #bcbcbc;
				border-radius:10px;
			}
			body{
				background:#393D49;
			}
		</style>
	</head>
	<body>
		<div class="login  layui-anim layui-anim-scale" >
			<form class="layui-form">
				<div class="layui-form-item">
					<label class="layui-form-label">输入登录名</label>
					<div class="layui-input-block">
						<input type="text" name="mobile" placeholder="输入登录名" class="layui-input" lay-verify="required">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">请输入密码</label>
					<div class="layui-input-block">
						<input type="password" name="pwd" placeholder="请输入密码" class="layui-input"  lay-verify="required">
					</div>
				</div>


				<div class="layui-form-item">
					<div class="layui-input-block">
						<button lay-submit lay-filter="do_login" class="layui-btn layui-btn-normal" style="width:100%;">账号登录</button>
					</div>
				</div>

				<div class="layui-form-item">
					<div class="layui-input-block">
						<button id="wx_login" class="layui-btn layui-btn-normal" style="width:100%;">微信登录</button>
					</div>
				</div>
			</form>
		</div>
	</body>
	<script src="/Public/layui/layui.all.js"></script>
	<script type="text/javascript">
		form.on('submit(do_login)', function(data){
			console.log(data);
			do_login(data.field);
			return false;
		});

		$(function(){
			$('#wx_login').click(function(){
				ajax('/Home/Index/wx_login',{},function(res){
					//console.log(res.url);
					window.location.href=res.url;
				});
				return false;
			})
		})
		function do_login(params){
			ajax('/Admin/Login/do_login',params,function(res){
				layer.msg('登录成功！');
				window.location.href="/Admin/Index/index";
			})
		}
	</script>
</html>